Skip to content

feat(bus): every event carries an id that survives a restart - #322

Merged
V3RON merged 6 commits into
mainfrom
task/316
Oct 4, 2026
Merged

V3RON merged 6 commits into
mainfrom
task/316

Conversation

@V3RON

@V3RON V3RON commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #316

Every event now carries id (evt_ plus the daemon's id generator), on every transport and in events.jsonl. The file reader, simlock events --follow and the console tell events apart by id alone. The file reader skips lines without a valid id. The protocol moves to 10. A relayed event still gets a gateway id; #317 changes that.

ADR 0014 is in #311. This PR cites it but does not add it, so merge #311 first or the citations dangle briefly.

Status

Implement: done (11/11 green) Review: round 2, 0 blocking open Mutate: 5 alive (explained) Hardware: n/a Gate: pending

Done when

  • simlock events prints an id on every line and the same id after a restart: e2e simlock events --since 1h after a daemon restart prints each event with the id it had before the restart.
  • A protocol-9 worker is incompatible and nothing it pushes is relayed: src/gateway/service.test.ts. Round 2 showed it fails if the gateway subscribes to such a worker.
  • eventKey and keyOf read id only: read in the diff. Console tests prove that the same seq and timestamp with different ids show twice.
  • Rule 7, both EVENTS.md files, HTTP-API.md, CLI.md and CLIENT.md name id. pnpm check passes.

Review

Spec review: 3 findings, 0 fixed. Code review: 9 findings, 3 fixed.
Mutate: 37 mutants, 5 alive. All 5 are on the subscribeDespiteFailure switch in src/gateway/test-support.ts (lines 238 and 456). That test-helper guard does something only when the gateway wrongly subscribes to an incompatible worker, so no correct production code can show the difference.

Rejected:

Written by an agent.

V3RON added 6 commits October 4, 2026 12:00
…re really proven (#316)

Review findings: the protocol-9 test could not fail on its second claim, and
nothing pinned idGenerator into the daemon's bus.
…hema refuses (#316)

1 failing -> 0 failing. One id shape (EVENT_ID_PATTERN) in the contract, used by the schema and the reader.
@V3RON
V3RON marked this pull request as ready for review October 4, 2026 10:55
@V3RON
V3RON merged commit a18ab2e into main Oct 4, 2026
24 checks passed
V3RON added a commit that referenced this pull request Oct 4, 2026
@V3RON
V3RON deleted the task/316 branch November 6, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Every event carries an id that survives a restart

1 participant